package cn.virens.common.boot.provider.apijson;

import apijson.orm.AbstractSQLConfig;
import cn.virens.common.boot.provider.apijson.autoconfig.ApijsonProperties;
import cn.virens.common.util.exception.APIException;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

public class APIJSONSQLConfig extends AbstractSQLConfig<String, JSONObject, JSONArray> {
    protected final ApijsonProperties props;

    public APIJSONSQLConfig(APIJSONParser parser) {
        super(parser.getMethod());
        this.props = parser.props;
    }

    @Override
    public String getSchema() throws APIException {
        return props.getDbSchema();
    }

    @Override
    public String gainDBVersion() throws APIException {
        return props.getDbVersion();
    }

    @Override
    public String gainDBAccount() throws APIException {
        return props.getDbAccount();
    }

    @Override
    public String gainDBPassword() throws APIException {
        return props.getDbPassword();
    }

    @Override
    public String gainDBUri() throws APIException {
        return props.getDbUri();
    }
}
